#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int Gcd(int a, int b)
{
	return b == 0 ? a : Gcd(b, a%b);
}
int main()
{
	int a, b;
	while (cin >> a >> b)
	{
		if ((a/Gcd(a, b)) % 2)
			cout << "A" << endl;
		else
			cout << "B" << endl;
	}
	return 0;
}
